<?php

use App\Models\Kms\Task\TaskTemplateModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterTableDailyTaskLogsAddTemplateType extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('kms_daily_task_logs', function (Blueprint $table) {
            $table->unsignedInteger('templateType')->default(0)
                  ->comment(enumToMigrationComment(TaskTemplateModel::TEMPLATE_TYPE_TEXT, "模版类型"))->after("uniqueSign");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('kms_daily_task_logs', function (Blueprint $table) {
            $table->dropColumn('templateType');
        });
    }
}
